package it.traveldream.entities;

import java.io.Serializable;
import java.lang.String;
import java.util.List;

import javax.persistence.*;

/**
 * Entity implementation class for Entity: MeanType
 *
 */
@Entity
@Table(name="MeanType")
@NamedQueries({
		@NamedQuery(
				name = "getMeanTypeByName",
				query = "SELECT m FROM MeanType m WHERE m.name = :name"
		),
		@NamedQuery(
				name = "getMeanTypes",
				query = "SELECT m FROM MeanType m"
				)
})
public class MeanType implements Serializable {

	@Transient
	public static final String TO_FLIGHT = "2";
	@Transient
	public static final String BACK_FLIGHT = "3";
	@Id
	private Long meanTypeId;
	private String name;
	private static final long serialVersionUID = 1L;

	@OneToMany(cascade = CascadeType.MERGE, mappedBy = "meanType")
	private List<TransportMean> meansOfType;
	
	public MeanType() {
		super();
	}   
	public MeanType(long id, String name) {
		super();
		this.meanTypeId = id;
		this.name = name;
	}
	
	public Long getId(){
		return this.meanTypeId;
	}
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}
   
}
